<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<!DOCTYPE html>
<html id="order">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>订单添加</title>
    <link href="/static/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/static/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="/static/css/animate.css" rel="stylesheet">
    <link href="/static/css/style.css?v=4.1.0" rel="stylesheet">
</head>

<body class="gray-bg">
    <div class="container wrapper wrapper-content animated fadeInRight">
        <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5>添加销售订单</h5><button onclick="javascript:location.reload();" type="button" class="btn btn-sm btn-outline btn-danger" style="margin-left:15px;margin-top: -6px;">刷 新</button>
            <span style="float:right;">
        </div>
        <div class="ibox-content">
            <form class="form-horizontal">
                <div class="form-group">
                    <label class="col-sm-3 control-label">种类选择</label>
                    <div class="col-sm-6">
                        <select class="form-control m-b" id="bankname">
                            <?php
                                foreach ($bankList as $bank) {
                                    echo "<option value='".$bank['id']."'>{$bank['bankname']}</option>";
                                }
                            ?>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">销售单价</label>
                    <div class="col-sm-6">
                        <input type="number" id="price" placeholder="请输入进货单价"  class="form-control">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">销售数量</label>
                    <div class="col-sm-6">
                        <input type="number" id="number" placeholder="请输入进货数量" class="form-control">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">客户</label>
                    <div class="radio i-checks">
                        <label class="">
                                        <div class="iradio_square-green ccc" checked style="position: relative;"><input type="radio" checked="checked" value="1" name="regulars" style="position: absolute; opacity: 0;"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; border: 0px; opacity: 0; background: rgb(255, 255, 255);"></ins></div> <i></i> 零售</label>
                                        <label class="">
                                            <div class="iradio_square-green ccc" style="position: relative;"><input type="radio" value="2" name="regulars" style="position: absolute; opacity: 0;"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; border: 0px; opacity: 0; background: rgb(255, 255, 255);"></ins></div> <i></i> 常客</label>
                                    </div>
                </div>
                        <div class="form-group" id="prompt">
                            <label class="col-sm-3 control-label"></label>
                            <div class="row">
                                <div class="col-sm-6">
                                    <div class="input-group">
                                        <input type="text" class="form-control" id="test_data">
                                        <div class="input-group-btn">
                                            <button type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown">
                                                <span class="caret"></span>
                                            </button>
                                            <ul class="dropdown-menu dropdown-menu-right" role="menu">
                                            </ul>
                                        </div>
                                        <!-- /btn-group -->
                                    </div>
                                </div>
                            </div>
                        </div>
                <div class="form-group">
                                <label class="col-sm-3 control-label">总价</label>

                                <div class="col-sm-6">
                                    <p class="form-control-static" id="total">0元</p>
                                </div>
                            </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">付款方式</label>
                    <div class="radio i-checks">
                        <label class="">
                                            <div class="iradio_square-green" checked style="position: relative;"><input type="radio" checked="checked" value="1" name="checkout" style="position: absolute; opacity: 0;"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; border: 0px; opacity: 0; background: rgb(255, 255, 255);"></ins></div> <i></i> 现金</label>
                                        <label class="">
                                            <div class="iradio_square-green" style="position: relative;"><input type="radio" value="2" name="checkout" style="position: absolute; opacity: 0;"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; border: 0px; opacity: 0; background: rgb(255, 255, 255);"></ins></div> <i></i> 签单</label>
                                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label" >备注</label>
                    <div class="col-sm-6">
                        <input id="memo" type="text" placeholder="请输入备注信息" class="form-control">
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-offset-3 col-sm-6">
                        <button class="btn btn-danger" type="button" id="submit">  提  交  </button>
                    </div>
                </div>
            </form>
        </div>
    </div>
    
    <div class="ibox float-e-margins">
        <div class="ibox-title" style="position:relative;">
            <h5>今日添加的销售订单</h5>
            <nav style="position:absolute;right: 16px;bottom: -21px;" class="page hidden-xs">

            </nav>
        </div>
            <nav class="page visible-xs">

            </nav>
        <span style="float:right;"></span>
    
    <div class="ibox-content">
        <div class="table-responsive">
            <table class="table table-striped">
                <thead>
                    <tr>
                        <th>#</th>
                        <th>鱼的种类</th>
                        <th>销售单价</th>
                        <th>销售数量</th>
                        <th>应收价格</th>
                        <th>实收价格</th>
                        <th>损耗￥</th>
                        <th>损耗的数量</th> 
                        <th>购买者</th>
                        <th>时间</th>
                        <th>付款状态</th>
                        <th>备注</th>
                        <th>状态</th>
                        <th>操作</th> 
                    </tr>
                </thead>
                <tbody>
                    <tr v-for="item in vdata">
                        <td>{{item.id}}</td>
                        <td>{{item.bankname}}</td>
                        <td>{{item.price}}</td>
                        <td>{{item.number}}</td> 
                        <td>{{item.amount}}</td>
                        <td>{{item.actual}}</td>
                        <td>{{item.loss}}</td> 
                        <td>{{item.lossnum}}</td>
                        <td>{{item.consumer}}</td>
                        <td>{{item.time}}</td>
                        <td v-if="item.payment == 0">已付款</td>
                        <td v-if="item.payment == 1">未付款</td>
                        <td v-if="item.payment == 2">部分付款</td>
                        <td>{{item.memo}}</td>
                        <td v-if="item.status == 0">未发货</td>
                        <td v-if="item.status == 1">已发货</td>
                        <td v-if="item.status == 2">退货</td>
                        <td v-if="item.status == 3">完成</td>
                        <td>
                            <select class="form-control m-b" v-model="selected" @change="type(item.id)">
                                <option value="0" selected>请选择状态</option>
                                <option v-if="item.status == 0" value="1">发货</option>
                                <option v-if="item.status == 1" value="2">完成</option>
                                <option v-if="item.status == 0" value="3">取消订单</option>
                                <option v-if="item.status == 3" value="4">退货</option>
                                <option v-if="item.status == 1" value="5">完成有损耗</option>
                            </select>
                        </td> 
                    </tr>
                </tbody>
            </table>
        </div>
    </div> 

</div>

    </div>

    <script src="/static/js/jquery.min.js?v=2.1.4"></script>
    <script src="/static/js/layer/layer.js" charset="utf-8"></script>
    <script src="/static/js/plugins/iCheck/icheck.min.js"></script>
    <script src="/static/js/vue.js"></script>
    <script src="/static/js/jquery.twbsPagination.js" charset="utf-8"></script>
    <script src="/static/js/plugins/suggest/bootstrap-suggest.min.js"></script>
    <script src="/static/js/order.js" charset="utf-8"></script>
    <script>
        $(document).ready(function () {
            $('.i-checks').iCheck({
                checkboxClass: 'icheckbox_square-green',
                radioClass: 'iradio_square-green',
            });
        });
        
        var testdataBsSuggest = $("#test_data").bsSuggest({
            indexId: 2, //data.value 的第几个数据，作为input输入框的内容
            indexKey: 1, //data.value 的第几个数据，作为input输入框的内容
            data: {
                'value': [
                    {
                        'id': '0',
                        'word': 'lzw',
                        'description': 'http://lzw.me'
                    },
                    {
                        'id': '1',
                        'word': 'lzwme',
                        'description': 'http://w.lzw.me'
                    },
                    {
                        'id': '2',
                        'word': 'meizu',
                        'description': 'http://www.meizu.com'
                    },
                    {
                        'id': '3',
                        'word': 'flyme',
                        'description': 'http://flyme.meizu.com'
                    }
   ],
                'defaults': 'http://lzw.me'
            }
        });
    </script>
</body>

</html>
